/*
 ============================================================================
 Name		: FM_RadioAppUi.h
 Author	  : kamal
 Copyright   : Your copyright notice
 Description : Declares UI class for application.
 ============================================================================
 */

#ifndef __FM_RADIOAPPUI_h__
#define __FM_RADIOAPPUI_h__

// INCLUDES
#include <aknappui.h>
#include <RadioPlayerUtility.h>
#include <RadioFmTunerUtility.h>

// FORWARD DECLARATIONS
class CFM_RadioAppView;

// CLASS DECLARATION
/**
 * CFM_RadioAppUi application UI class.
 * Interacts with the user through the UI and request message processing
 * from the handler class
 */
class CFM_RadioAppUi: public CAknAppUi, public MRadioPlayerObserver, public MRadioFmTunerObserver
{
	public:
		// Constructors and destructor

		/**
		 * ConstructL.
		 * 2nd phase constructor.
		 */
		void ConstructL();

		/**
		 * CFM_RadioAppUi.
		 * C++ default constructor. This needs to be public due to
		 * the way the framework constructs the AppUi
		 */
		CFM_RadioAppUi();

		/**
		 * ~CFM_RadioAppUi.
		 * Virtual Destructor.
		 */
		virtual ~CFM_RadioAppUi();\

	public:
		//MRadioPlayerObserver
		void MrpoStateChange(TPlayerState aState, TInt aError);
		void MrpoVolumeChange(TInt aVolume);
		void MrpoMuteChange(TBool aMute);
		void MrpoBalanceChange(TInt aLeftPercentage, TInt aRightPercentage);

	public:
		//MRadioFmTunerObserver
		void MrftoRequestTunerControlComplete(TInt aError);
		void MrftoSetFrequencyRangeComplete(TInt aError);
		void MrftoSetFrequencyComplete(TInt aError);
		void MrftoStationSeekComplete(TInt aError, TInt aFrequency);
		void MrftoFmTransmitterStatusChange(TBool aActive);
		void MrftoAntennaStatusChange(TBool aAttached);
		void MrftoOfflineModeStatusChange(TBool aOfflineMode);
		void MrftoFrequencyRangeChange(TFmRadioFrequencyRange aBand /*, TInt aMinFreq, TInt aMaxFreq*/);
		void MrftoFrequencyChange(TInt aNewFrequency);
		void MrftoForcedMonoChange(TBool aForcedMono);
		void MrftoSquelchChange(TBool aSquelch);

	private:
		// Functions from base classes

		/**
		 * From CEikAppUi, HandleCommandL.
		 * Takes care of command handling.
		 * @param aCommand Command to be handled.
		 */
		void HandleCommandL(TInt aCommand);

		/**
		 *  HandleStatusPaneSizeChange.
		 *  Called by the framework when the application status pane
		 *  size is changed.
		 */
		void HandleStatusPaneSizeChange();

		/**
		 *  From CCoeAppUi, HelpContextL.
		 *  Provides help context for the application.
		 *  size is changed.
		 */
		CArrayFix<TCoeHelpContext>* HelpContextL() const;

		TBool InitializeRadio();
		void StartRadio();
		void StopRadio();

	private:
		// Data

		/**
		 * The application view
		 * Owned by CFM_RadioAppUi
		 */
		CFM_RadioAppView* iAppView;
		CRadioUtility* iRadioUtility;
		CRadioFmTunerUtility* iFmTunerUtility;
		CRadioPlayerUtility* iPlayerUtility;
		TBool iAvailableFlag;

};

#endif // __FM_RADIOAPPUI_h__
// End of File
